
var routerBeforeEachdConfig = (to, from,next) => {
    // to将要访问的路径
    //   from 代表从哪个路径来
    //   next 是一个函数,表示放行

    if(to.path === '/login'){
        return next();
    }

    const tokenStr = window.sessionStorage.getItem('token');

    if(tokenStr){
        next();
    }else{
        return next('/login');
    }
};

export default routerBeforeEachdConfig;
